package com.leo.train.member.controller.admin;

import com.leo.train.common.resp.CommonResp;
import com.leo.train.common.resp.PageResult;
import com.leo.train.member.dto.TicketDto;
import com.leo.train.member.service.TicketService;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/ticket")
@Slf4j
public class TicketAdminController {
    @Autowired
    private TicketService ticketService;

    /**
     * 查询列表
     * @param ticketDto
     * @return
     */
    @GetMapping("/list")
    public CommonResp<PageResult> list(@Valid TicketDto ticketDto){
        log.info("查询列表：{}", ticketDto);
        PageResult pageResult = ticketService.list(ticketDto);
        return new CommonResp<>(pageResult);
    }
}
